<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<!DOCTYPE HTML>
<html>
<head>
    <c:set var="contextPath" value="${pageContext.request.contextPath}"/>
    <meta charset="utf-8">
    <meta name="viewport"
          content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>上报案件</title>
    <link rel="stylesheet" type="text/css" href="${contextPath}/resources/city/css/public-style.css"/>
    <link rel="stylesheet" type="text/css" href="${contextPath}/resources/city/css/cancel.css"/>
    <style>
        .shangbao {
            margin: 0 auto;
            text-align: center;
        }
    </style>
</head>
<body>
<form:form commandName="formDto" id="form">
    <form:hidden path="caseUuid"/>
    <!-- 内容 -->
    <div id="main">
        <!-- 头部 -->
        <header>
            <img src="${contextPath}/resources/city/image/return.png" id="fanHui"/>
            <span id="tilte">上报案件</span>
        </header>

        <div class="content">
            <div class="reason bg">
                <div class="title">上报原因</div>
                <textarea name="content" id="content" placeholder="请填写上报原因" class="ErrorText"></textarea>
            </div>
        </div>
        <c:if test="${sessionScope.employee.inspector}">
            <div class="shangbao">
                <label style="font-size: small">
                    上报至平台
                    &nbsp;&nbsp;&nbsp;
                    <form:checkbox path="reportPlatform"/>
                </label>
                <span class="fa fa-info-circle" data-container="body" data-toggle="popover"
                      data-placement="right" data-content="如勾选则上报到平台中进行处置" data-original-title=""
                      title=""></span>
                <script type="text/javascript">
                    $('[data-toggle="popover"]').popover({html: true});
                </script>
            </div>
        </c:if>
        <div class="bg-blue" id="SubmitBtn">
            提交
        </div>
    </div>
</form:form>
</body>
<script src="${contextPath}/resources/city/js/remJs.js"></script>
<script src="${contextPath}/resources/city/js/jquery-1.8.0.min.js"></script>
<script>
    $("#SubmitBtn").click(function () {
        var serialize = $("#form").serialize();
        $.ajax({
            url: 'report',
            data: serialize,
            type: 'post',
            cache: false,
            success: function (data) {
                if (data.state) {
                    self.location.href = "case_complete.htm";
                } else {
                    $(".ErrorText").css("border-color", "red");
                }
            },
            error: function () {
                alert("失败");
            }
        });
    });
    $('#fanHui').click(function () {
        self.location.href = "javascript:window.history.go(-1);";
    });
</script>
</html>